Skip to content

Make the SMTP relay's pinned address configurable - #18

Merged
dabeckham merged 3 commits into
mainfrom
chore/configurable-smtp-relay-address
Jul 26, 2026
Merged

Make the SMTP relay's pinned address configurable#18
dabeckham merged 3 commits into
mainfrom
chore/configurable-smtp-relay-address

Conversation

@dabeckham

Copy link
Copy Markdown
Owner

What

docker-compose.yml hard-coded "mail.eigbox.net:66.96.134.48" in
extra_hosts. It is now SMTP_RELAY_HOST / SMTP_RELAY_IP, with the current
values as defaults so a fresh clone still starts.

Why — this line is load-bearing

Checked before touching it, and the finding is more interesting than expected:

Address Source Reachable from the container network?
38.113.1.135 what mail.eigbox.net resolves to in public DNS today No[Errno 113] No route to host
66.96.134.48 what extra_hosts pins it to Yes — answers as bosauthsmtp04.yourhostingaccount.com, STARTTLS verifies against *.eigbox.net

So share-by-email works today entirely because of that line. Public DNS has
already moved on. Deleting the pin would break mail; leaving it hard-coded means
that when the provider eventually retires this address, mail starts timing out
with nothing else affected and nothing pointing at the cause.

The app has to connect by hostname — the certificate is only valid for
*.eigbox.net, so connecting by address fails verification. Hence a pin rather
than just an IP in SMTP_HOST.

On publishing the address

Keeping 66.96.134.48 as the default in the repo is deliberate. It is a shared
relay operated by the hosting provider, not this infrastructure, and it
announces its own hostname on connect. The value in moving it to .env is
operational — being able to correct it without a code change — not
confidentiality. A fresh clone that fails to start because a required variable
is unset would be a worse trade.

Also added

A runbook entry under Common issues → Relay address, with a probe that
reports what the container resolves, whether the address answers, and whether
the certificate still verifies — so the next person diagnosing "mail stopped
working and nothing else did" has somewhere to start.

Verification

docker compose config renders the correct extra_hosts entry with the
variables set, unset, and absent from .env entirely. No application code
changes.

docker-compose.yml hard-coded "mail.eigbox.net:66.96.134.48" in extra_hosts.
The mapping is load-bearing, not decoration: the relay's certificate is only
valid for the hostname, but the hostname's public DNS record now resolves to
38.113.1.135, which this network cannot reach at all. The pinned address still
answers, so share-by-email works today entirely because of that line — and
would break silently, with nothing else affected, the day the provider retires
it.

Now driven by SMTP_RELAY_HOST / SMTP_RELAY_IP with the current values as
defaults, so a fresh clone still starts and the address can be corrected from
.env without a code change. Added a runbook entry with a probe that reports
what the container resolves, whether the address answers, and whether the
certificate still verifies.

Verified the interpolation renders correctly with the variables set, unset,
and absent from .env entirely.
@dabeckham
dabeckham merged commit 90a20c0 into main Jul 26, 2026
2 checks passed
@dabeckham
dabeckham deleted the chore/configurable-smtp-relay-address branch July 26, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant